package JSP;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import pojo.User;
import utils.JDBCutils;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public class Test {
    public static void main(String[] args) throws SQLException {
        QueryRunner queryRunner = new QueryRunner();
        Connection conn = JDBCutils.getConn();
        String sql = "SELECT `username` FROM books WHERE `username` LIKE  ?\"%\" ";
        List<User> users = queryRunner.query(conn, sql, new BeanListHandler<User>(User.class), "陈");
        System.out.println(users);

    }
}
